<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateGuildBalance extends Migration
{
    protected $connection = 'guild';

    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('guild_balance', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户ID');
            $table->decimal('have_access_balance', 20)->default(0)->comment('可提现余额');
            $table->decimal('audit_access_balance', 20)->default(0)->comment('审核中余额(冻结余额)');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('guild_balance');
    }
}
